<template>
  <div class="preWorkBox">
    <!-- 老化信息 -->
    <div class="content">
      <div class="contentDiv">
        <h1 style="margin-left:40%">产品老化信息</h1>
        <el-form ref="form" class="perForm" :model="form" label-width="120px" size="medium" :inline="true" style="margin-top: 30px">
          <el-row>
            <el-form-item label="整机条码" prop="completeMachineCode">
              <el-input v-model="form.completeMachineCode" type="textarea" placeholder="输入整机条码" :rows="3" style="width: 400px;" @change="getData" />
            </el-form-item>
          </el-row>
          <el-form-item label="整机条码" prop="caseId">
            <el-input v-model="form.caseId" :disabled="true" />
          </el-form-item>
          <el-form-item label="产线号" prop="lineId">
            <el-input v-model="form.lineId" :disabled="true" />
          </el-form-item>
          <el-form-item label="老化房号" prop="burninId">
            <el-input v-model="form.burninId" :disabled="true" />
          </el-form-item>
          <el-form-item label="调试台号" prop="testId">
            <el-input v-model="form.testId" :disabled="true" />
          </el-form-item>
          <el-form-item label="产品型号" prop="productStandard">
            <el-input v-model="form.productStandard" :disabled="true" />
          </el-form-item>
          <el-form-item label="生产批号" prop="taskId">
            <el-input v-model="form.taskId" :disabled="true" />
          </el-form-item>
          <el-form-item label="质检员" prop="inspectName">
            <el-input v-model="form.inspectName" :disabled="true" />
          </el-form-item>
          <el-form-item label="老化人员" prop="agingName">
            <el-input v-model="form.agingName" :disabled="true" />
          </el-form-item>
          <el-form-item label="调试人员" prop="debugName">
            <el-input v-model="form.debugName" :disabled="true" />
          </el-form-item>
          <el-form-item label="客户名称" prop="customer">
            <el-input v-model="form.customer" :disabled="true" />
          </el-form-item>
          <el-form-item label="产品类型" prop="productType">
            <el-input v-model="form.productType" :disabled="true" />
          </el-form-item>
          <el-form-item label="质检结果" prop="inspectResult">
            <el-input v-model="form.inspectResult" :disabled="true" />
          </el-form-item>
          <el-form-item label="老化结果" prop="ageingResult">
            <el-input v-model="form.ageingResult" :disabled="true" />
          </el-form-item>
          <el-form-item label="调试结果" prop="debugResult">
            <el-input v-model="form.debugResult" :disabled="true" />
          </el-form-item>
        </el-form>

        <el-tag size="large" style="font-size: 20px;">组装质检信息</el-tag>
        <el-table :data="assembleList" width="80%">
          <el-table-column label="物料编码" align="center" prop="materialId" />
          <el-table-column label="物料名称" align="center" prop="materialName" />
          <el-table-column label="物料规格" align="center" prop="materialStandard" />
          <el-table-column label="批次流水号" align="center" prop="materialBatch" />
          <el-table-column label="安装时间" align="center" prop="installTime" />
          <el-table-column label="装配员" align="center" prop="installName" />
          <!-- <el-table-column label="检测日期" align="center" prop="inspectDate" width="180">
                  <template slot-scope="scope">
                  <span>{{ parseTime(scope.row.inspectDate, '{y}-{m}-{d}') }}</span>
                  </template>
          </el-table-column>-->
        </el-table>

        <el-tag size="large" style="font-size: 20px;">老化信息</el-tag>
        <el-table :data="agingList2" width="80%">
          <el-table-column label="报警时间" align="center" prop="alarmTime" />
          <el-table-column label="参数名称" align="center" prop="parameterName" />
          <el-table-column label="参数值" align="center" prop="parameterValue" />
          <el-table-column label="故障等级" align="center" prop="faultLevel" />
          <el-table-column label="故障状态" align="center" prop="faultState" />
        </el-table>
        <el-table :data="agingList" width="80%">
          <el-table-column label="时间" align="center" prop="time" />
          <el-table-column label="DCDC电压" align="center" prop="dcdcV" />
          <el-table-column label="DCDC电流" align="center" prop="dcdcA" />
          <el-table-column label="DCAC1电压" align="center" prop="dcac1V" />
          <el-table-column label="DCAC1电流" align="center" prop="dcac1A" />
          <el-table-column label="DCAC2电压" align="center" prop="dcac2V" />
          <el-table-column label="DCAC2电流" align="center" prop="dcac2A" />
          <el-table-column label="电驱电压" align="center" prop="dqV" />
          <el-table-column label="电驱电流" align="center" prop="dqA" />
          <el-table-column label="充电机电流" align="center" prop="cdjA" />
        </el-table>

        <el-tag size="large" style="font-size: 20px;">维修记录</el-tag>
        <!-- <el-form
            ref="maintenanceRecords"
            class="perForm"
            :model="maintenanceRecords"
            label-width="120px"
            size="medium"
            :inline="true"
            style="margin-top: 15px"
          >
              <el-form-item label="生成日期" prop="generationTime">
                  <el-input v-model="maintenanceRecords.generationTime" />
              </el-form-item>
              
        </el-form>-->
        <el-table :data="maintenanceRecords" width="80%">
          <el-table-column label="维修时间" align="center" prop="faultTime" />
          <el-table-column label="维修人" align="center" prop="faultName" />
          <el-table-column label="送修时间" align="center" prop="giveTime" />
          <el-table-column label="送修人" align="center" prop="giveName" />
          <el-table-column label="故障类型" align="center" prop="faultType" />
          <el-table-column label="故障定位" align="center" prop="faultPosition" />
          <el-table-column label="失效分析人" align="center" prop="analysisName" />
          <el-table-column label="装配线" align="center" prop="lineNumber" />
        </el-table>
      </div>
    </div>
  </div>
</template>

<script>
import { agingInformationData } from "@/api/apppro/index";
export default {
  name: "agingInformation",
  data() {
    return {
      form: {},
      //老化信息form
      agingList2: [],
      //维修记录
      maintenanceRecords: [],
      // loading: false,
      // templateList: []
      //组装质检信息
      assembleList: [],
      //老化信息table
      agingList: []
    };
  },
  created() { },
  methods: {
    //输入整机条码事件
    getData() {
      // this.form.completeMachineCode = "1056862023091100210820005380019";
      let params = {
        caseId: this.form.completeMachineCode
      };
      agingInformationData(params).then(res => {
        console.log(res, "老化信息整机条码res");
        if (res.code == 200) {
          if (res.data.caseInfo) {
            this.form = res.data.caseInfo
          }
          if (res.data.modelInstallList) {
            this.assembleList = res.data.modelInstallList
          }
          if (res.data.electricalParameterList) {
            this.agingList = res.data.electricalParameterList
          }
          if (res.data.faultInformationList) {
            this.agingList2 = res.data.faultInformationList
          }
          if (res.data.maintenanceRecordList) {
            this.maintenanceRecords = res.data.maintenanceRecordList
          }
        }
      });
    }
    //submitForm() {},
  }
};
</script>
<style lang="scss" scoped>
.contentDiv {
  width: 1350px;
}
</style>
  